package models

import (
	"go-mgdms/internal/common/config"
)

// CaptchaModel 验证码数据模型
type CaptchaModel struct {
	Key        string `gorm:"type:varchar(32);primaryKey;comment:验证码Key" json:"key"`
	Code       string `gorm:"type:varchar(32);not null;default:'';comment:验证码(加密后)" json:"code"`
	Captcha    string `gorm:"type:text;comment:验证码数据" json:"captcha"`
	CreateTime uint64 `gorm:"type:bigint;unsigned;comment:创建时间" json:"create_time"`
	ExpireTime uint64 `gorm:"type:bigint;unsigned;comment:过期时间" json:"expire_time"`
}

// TableName 设置表名
func (CaptchaModel) TableName() string {
	return config.GetTablePrefix() + "captcha"
}
